<?php
namespace App\Helpers;

class Factory
{
    //简单工厂模式
    public static function createPeople($type)
    {
        switch ($type) {
            case 'man':
                return new \App\Helpers\Man();
                break;
            case 'women':
                return new \App\Helpers\Women();
                break;
            default:
                throw new Exception('type error!');
                break;
        }
    }
    public static function createMan()
    {
        return new \App\Helpers\Man();
    }
    public static function createWomen()
    {
        return new \App\Helpers\Women();
    }
}
